#!/usr/bin/env groovy
// @file     Test
// @author   Mac Radigan
// @purpose  

package sys.test

import sys.tools.*
import sys.finance.*
import sys.xml.*

import javax.persistence.*
import static org.w3c.dom.Node.*

public class TestTool extends Tool {

  public String getName() {
    return "test"
  }

  public String getDescription() {
    return "Test driver."
  }

  public String run(String[] args) {
    println "test ${args}"
    EntityManagerFactory entityManagerFactory =  Persistence.createEntityManagerFactory("Finance");
    EntityManager em = entityManagerFactory.createEntityManager();
    EntityTransaction optionTransaction = em.getTransaction();
    optionTransaction.begin();
    Option option = new Option();
    em.persist(option);
    optionTransaction.commit();
    em.close();
    entityManagerFactory.close();
  }

}

/* *EOF* */
